package com.tsingteng.cosfun.ui.message.geneal.model;

import com.tsingteng.cosfun.bean.DataBean;
import com.tsingteng.cosfun.bean.FollowBean;
import com.tsingteng.cosfun.bean.ParagraphComment;
import com.tsingteng.cosfun.bean.PlayBean;
import com.tsingteng.cosfun.bean.PlayCommont;
import com.tsingteng.cosfun.bean.PlayDetailsBean;
import com.tsingteng.cosfun.bean.PullBlackBean;
import com.tsingteng.cosfun.bean.UserBean;
import com.tsingteng.cosfun.callback.RxObserver;
import com.tsingteng.cosfun.http.RxSchedulers;
import com.tsingteng.cosfun.mvp.module.BaseModel;

import java.util.List;

import retrofit2.Callback;

/**
 * 描述 :
 * 创建人: 肖利.
 * 时间:2018/8/8
 * qq(872179966)
 */

public class PlayModel extends BaseModel implements IPlayModel {

    /**
     * 便当列表
     * @param currentPage
     * @param count
     * @param callback
     */
    @Override
    public void getPlayList(String currentPage, String count, RxObserver<PlayBean> callback) {
        doRxRequest().getPlayList(currentPage,count).compose(RxSchedulers.io_main()).subscribe(callback);
    }

    /**
     * 便当详情

     * @param paragraphId
     * @param callback
     */
    @Override
    public void getPlayDetails( String paragraphId, RxObserver<PlayDetailsBean> callback) {
        doRxRequest().getPlayDetails(paragraphId).compose(RxSchedulers.io_main()).subscribe(callback);
    }

    /**
     * 便当详情评论列表
     * @param paragraphId
     * @param currentPage
     * @param count
     * @param callback
     */
    @Override
    public void getPlayDetailsCommontList(String paragraphId, String currentPage, String count, RxObserver<PlayCommont> callback) {
        doRxRequest().getPlayDetailsCommontList(paragraphId,currentPage,count).compose(RxSchedulers.io_main()).subscribe(callback);
    }

    /**
     * 添加便当
     * @param content
     * @param callback
     */
    @Override
    public void getAddPlay(String content, RxObserver<String> callback) {
        doRxRequest().getAddPlay(content).compose(RxSchedulers.io_main()).subscribe(callback);
    }

    /**
     * 删除便当
     * @param paragraph_id
     * @param callback
     */
    @Override
    public void getDelPlay(String paragraph_id, RxObserver<String> callback) {
        doRxRequest().getDelPlay(paragraph_id).compose(RxSchedulers.io_main()).subscribe(callback);
    }

    /**
     * 添加不喜欢的段子
     * @param paragraph_id
     * @param callback
     */
    @Override
    public void getAddNotLikePlay(String paragraph_id, RxObserver<String> callback) {
        doRxRequest().getAddNotLikePlay(paragraph_id).compose(RxSchedulers.io_main()).subscribe(callback);
    }

    /**
     *  段子或者评论点赞或取消点赞 点赞类型0-段子 1-段子评论或回复
     * @param id
     * type
     * @param type
     * @param callback
     */
    @Override
    public void getPraiseOrNot(String praise_type,String id, String type, RxObserver<Integer> callback) {
        doRxRequest().getPraiseOrNot(praise_type,id,type).compose(RxSchedulers.io_main()).subscribe(callback);
    }
    /**
     * 观看便当时长
     * @param time_length
     * type
     * @param start_time
     * @param callback
     */
    @Override
    public void getDataLongTime(String start_time, String time_length, RxObserver<DataBean> callback) {
        doRxRequest().getDataLongTime(start_time,time_length).compose(RxSchedulers.io_main()).subscribe(callback);
    }

    /**
     *  //评价段子或回复  评论类型0-便当 1-段子
     * @param paragraph_id
     * @param comment_type
     * @param content
     * @param comment_object_id
     * @param callback
     */
    @Override
    public void getAddPlayComment(String paragraph_id, String comment_type, String content, String comment_object_id, RxObserver<ParagraphComment> callback) {
        doRxRequest().getAddPlayComment(paragraph_id,comment_type,content,comment_object_id).compose(RxSchedulers.io_main()).subscribe(callback);
    }

    /**
     * 关注
     */
    @Override
    public void getFollowNotification(String follow_id, RxObserver<FollowBean> callback) {
        doRxRequest().getFollowPerson(follow_id).compose(RxSchedulers.io_main()).subscribe(callback);
    }

    /**
     * 取消关注
     */
    @Override
    public void getNoFollowNotification(String follow_id, RxObserver<FollowBean> callback) {
        doRxRequest().getNoFollow(follow_id).compose(RxSchedulers.io_main()).subscribe(callback);
    }

    /**
     *
     * 取消拉黑
     */
    @Override
    public void getCancelPullBlackInfo(long user_id, Callback<PullBlackBean> workCallback) {
        doRxRequest().cancelPullBlack(user_id + "").enqueue(workCallback);
    }
}
